use "${hmrc_datadir}\CT600\ct600_fame_ETR.dta"
keep accounting_period_end_date year identifier year_aped
save "${hmrc_datadir}\CT600\ct600_ap.dta", replace
tab year
gen ap_month=month( accounting_period_end_date)
tab ap_month
save "${hmrc_datadir}\CT600\ct600_ap.dta", replace

use "${hmrc_datadir}\CT600\ct600_ap.dta", clear
merge 1:m year identifier using "${hmrc_datadir}\export_reg_final_ukmncs_fy"
drop if _merge==1
drop _merge
save "${hmrc_datadir}\export_reg_final_ukmncs_fy_ap", replace

use "${hmrc_datadir}\CT600\ct600_ap.dta", clear
merge 1:m year identifier using "${hmrc_datadir}\export_reg_final_mncs_fy"
drop if _merge==1
drop _merge
save "${hmrc_datadir}\export_reg_final_mncs_fy_ap", replace
